package com.xing.bean.test;

import com.xing.bean.DefaultBeanFactory;
import com.xing.bean.api.IBeanFactory;

public class BeanMain {

    public static void main(String[] args) throws Exception{
        IBeanFactory beanFactory = new DefaultBeanFactory();
        TestBean testBean = beanFactory.registBean(TestBean.class);
        testBean.setName("hello");

        TestBeanService service = beanFactory.registBean(TestBeanService.class);
        service.print();

        beanFactory.registLazyBean(LazyBeanService.class);
//		LazyBeanService lazyService = beanFactory.getBean(LazyBeanService.class);
//		lazyService.print();

        AutoRefBeanService autoRefService = beanFactory.registBean(AutoRefBeanService.class);
        autoRefService.print();

    }
}
